<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<#if model??>
<html>
<head>
    <title>${model.tableDesc}</title>
    <%@ include file="../<#if model.model!=model.className?uncap_first>../</#if>include/head.jsp"%>
</head>
<body>
<div class="admin-content">
    <div class="am-g">
        <div class="am-u-sm-12">
            <form class="am-form am-form-horizontal" data-am-validator modelAttribute="${model.className?uncap_first}" action="${"$"}{ctx}/${model.model}<#if model.model!=model.className?uncap_first>/${model.className?uncap_first}</#if>/<c:choose><c:when test="${"$"}{empty ${model.className?uncap_first}.id}">create</c:when><c:otherwise>update</c:otherwise></c:choose>" method="post">
            <input type="hidden" name="id" value="${"$"}{${model.className?uncap_first}.id}"/>
            <#list model.columns as column>
                <#if column.columnName=="id">
                <#elseif column.columnName=="createDate">
                <#elseif column.columnName=="updateDate">
                <#elseif column.columnName=="createBy">
                <#elseif column.columnName=="updateBy">
                <#elseif column.columnName=="status">
                <#else>
                <div class="am-form-group">
                    <label class="am-u-sm-3 am-form-label">${column.columnDesc}：</label>
                    <div class="am-u-sm-8">
                        <input type="text" name="${column.columnName?uncap_first}" placeholder="${column.columnDesc}" value="${"$"}{${model.className?uncap_first}.${column.columnName?uncap_first}}" required/>
                    </div>
                    <label class="am-u-sm-1"></label>
                </div>
                </#if>
            </#list>
                <div class="am-form-group">
                    <div class="am-u-sm-9 am-u-sm-push-3">
                        <button type="submit" class="am-btn am-btn-primary">保存</button>
                        <button type="button" class="am-btn am-btn-danger" onclick="closeModel(false)">关闭</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<%@ include file="../<#if model.model!=model.className?uncap_first>../</#if>include/bottom.jsp"%>
<script type="text/javascript">
    ${"$"}(document).ready(function () {
        var msg = '${"$"}{msg}';
        if(msg!=''){
            iuMsg(msg);
            closeModel(true);//关闭窗口
        }
    });
</script>
</body>
</html>
</#if>